<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        #box {
            width: 300px;
            height: 300px;
            border: 1px solid black;
            overflow-y: scroll;
        }
        #box2 {
            height: 700px;
        }
    </style>
</head>
<body>
    <div id="box">
        <div id="box2"></div>
    </div>

    <script>
        
        /*
            e.wheelDelta
                -120 下滚
                120  上滚
        */
        box.addEventListener('mousewheel', function(e) {
            console.log(e.wheelDelta);

        })

    </script>
</body>
</html>